]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspace: Use boundingBox instead of getOriginalPosition()
authorJonas Dreßler <verdre@v0yd.nl>
Sun, 31 May 2020 21:19:59 +0000 (23:19 +0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 2 Jun 2020 23:03:06 +0000 (23:03 +0000)
The getOriginalPosition() API of WindowClone can easily be replaced by
using the existing boundingBox property, which reflects the windows
bounding box in absolute coordinates. This property is also used
everywhere else in the Workspace object, so we can use it here, too.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1294

js/ui/workspace.js

index 960514911587fc2dfcc83883710433d27c230fc4..6521275eac4b07895cd4d4888b58456305c72272 100644 (file)
@@ -274,10 +274,6 @@ var WindowClone = GObject.registerClass({
         return this._boundingBox.height;
     }
 
-    getOriginalPosition() {
-        return [this._boundingBox.x, this._boundingBox.y];
-    }
-
     _computeBoundingBox() {
         let rect = this.metaWindow.get_frame_rect();
 
@@ -1726,11 +1722,10 @@ class Workspace extends St.Widget {
             overlay.hide();
 
         if (clone.metaWindow.showing_on_its_workspace()) {
-            let [origX, origY] = clone.getOriginalPosition();
             clone.scale_x = 1;
             clone.scale_y = 1;
-            clone.x = origX;
-            clone.y = origY;
+            clone.x = clone.boundingBox.x;
+            clone.y = clone.boundingBox.y;
             clone.ease({
                 opacity,
                 duration,
@@ -1778,10 +1773,9 @@ class Workspace extends St.Widget {
             overlay.hide();
 
         if (clone.metaWindow.showing_on_its_workspace()) {
-            let [origX, origY] = clone.getOriginalPosition();
             clone.ease({
-                x: origX,
-                y: origY,
+                x: clone.boundingBox.x,
+                y: clone.boundingBox.y,
                 scale_x: 1,
                 scale_y: 1,
                 opacity: 255,